package com.shebao.utils;

/**
 * Created by Administrator on 2017\12\21 0021.
 */
public class FrankTest {

    public static void main(String[] args) {

        String str = "38,72,58,58,59,58,59,58,59,59,58,59,59,58,59,57,57,38,86,71,38";

        String[] split = str.split(",");
        float[] splitIntArray = new float[split.length];
        float count = 0;
        for (int i=0;i<split.length;i++){
            Float num = Float.valueOf(split[i]);
            count += num;
            splitIntArray[i] = num;
        }

        System.out.println("个数"+splitIntArray.length);
        float total = 842.0f;
        StringBuffer stringBuffer = new StringBuffer();
        for (float temp : splitIntArray){

            float a = temp/count;
            System.out.println(a);

            stringBuffer.append(a * total).append("f,");

        }

        System.out.println(stringBuffer.toString());


    }
}
